﻿<Window x:Class="BOL.Apps.GeneNetworkBrowser.Windows.GeneValuesWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:core="clr-namespace:BOL.Apps.GeneNetworkBrowser"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        Title="Add Custom Gene Values" Height="445" Width="400">
    <StackPanel Margin="5">
        <TextBlock TextWrapping="Wrap">Add custom key/value pairs to genes in network targets for further analyses.</TextBlock>
        <GroupBox Header="Network">
            <StackPanel>
                <DockPanel>
                    <TextBlock VerticalAlignment="Center" Margin="20,0,5,0" Text="Apply to:" />
                    <ComboBox Name="_cbNetworkTarget" Margin="0,0,110,0">
                        <ComboBoxItem IsSelected="True">Current Network</ComboBoxItem>
                        <ComboBoxItem>All Open Networks</ComboBoxItem>
                        <ComboBoxItem>All Networks In Current Projects</ComboBoxItem>
                        <ComboBoxItem>All Networks In All Open Projects</ComboBoxItem>
                    </ComboBox>
                </DockPanel>
            </StackPanel>
        </GroupBox>
        <GroupBox Header="Data">
            <StackPanel>
                <TextBlock TextWrapping="Wrap" Margin="5">Open a text file starting with an identifier column:</TextBlock>
                <DockPanel Margin="20,0,5,0">
                    <TextBlock VerticalAlignment="Center" Margin="0,0,5,0">Delimiter:</TextBlock>
                    <RadioButton GroupName="Delimiter" Name="_rbDelimiterTab" Content="Tab" IsChecked="True" VerticalAlignment="Center" Margin="0,0,5,0" />
                    <RadioButton GroupName="Delimiter" Name="_rbDelimiterComma" Content="Comma" VerticalAlignment="Center" Margin="0,0,5,0" />
                    <RadioButton GroupName="Delimiter" Name="_rbDelimiterCustom" Content="Custom" VerticalAlignment="Center" Margin="0,0,5,0" />
                    <TextBox Name="_tbDelimiterCustom" IsReadOnly="{Binding ElementName=_rbCustomDelimiter, Path=IsSelected}" />
                </DockPanel>
                <DockPanel Margin="20,5,5,0">
                    <CheckBox Margin="0,0,20,0" Name="_cbFirstRowHeader" VerticalAlignment="Center" IsChecked="True">First row contains header</CheckBox>
                    <TextBlock Text="Number of lines displayed" Margin="0,0,5,0" VerticalAlignment="Center" />
                    <TextBox Name="_tbNumberToShow" Width="20" VerticalAlignment="Center" HorizontalContentAlignment="Right">5</TextBox>
                </DockPanel>
                <DockPanel Margin="20,5,5,0">
                    <TextBox Width="230" Name="_tbFileName" IsReadOnly="True" Margin="0,0,5,0" />
                    <Button Click="Browse">Browse...</Button>
                </DockPanel>
                <TextBlock TextWrapping="Wrap" Margin="5">Edit each key for values :</TextBlock>
                <DataGrid Name="_dgPreview" Margin="20,0,5,0" Height="130" AutoGenerateColumns="True" SelectionMode="Single"  
                     CanUserAddRows="False" CanUserSortColumns="False" CanUserDeleteRows="False" IsReadOnly="True"
                     AlternatingRowBackground="LightGray" ItemsSource="{Binding}">
                    <DataGrid.ColumnHeaderStyle>
                        <Style TargetType="DataGridColumnHeader" >
                            <Setter Property="ContentTemplate" >
                                <Setter.Value>
                                    <DataTemplate>
                                        <DockPanel>
                                            <TextBox Text="{TemplateBinding Content}"/>
                                        </DockPanel>
                                    </DataTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </DataGrid.ColumnHeaderStyle>
                    <DataGrid.Resources>
                        <ObjectDataProvider x:Key="_geneIdType" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
                            <ObjectDataProvider.MethodParameters>
                                <x:Type TypeName="core:GeneIdType" />
                            </ObjectDataProvider.MethodParameters>
                        </ObjectDataProvider>
                    </DataGrid.Resources>
                    <!--<DataGrid.Columns>
                        <DataGridComboBoxColumn x:Name="_dgcbIdType" ItemsSource="{Binding Source={StaticResource _geneIdType}}" />
                    </DataGrid.Columns>-->
                </DataGrid>
            </StackPanel>
        </GroupBox>
        <Separator Margin="0,5,0,5"/>
        <WrapPanel HorizontalAlignment="Right">
            <Button IsDefault="True" Margin="0,0,5,0" Click="OK" Content="OK" />
            <Button IsCancel="True" Content="Cancel" />
        </WrapPanel>
    </StackPanel>
</Window>
